package pritace

import "fmt"

type Point struct {
	X int
	Y int
}

type Cat struct {
	Color string
	Name  string
}

type People struct {
	name  string
	child *People
}

type songer struct {
	name   string
	age    int
	sex    byte
	adress string
}

func StructMain() {

	// var p Point
	// p.X = 1
	// p.Y = 2

	// ins := new(Point)
	// ins.X = 3
	// ins.Y = 4

	// relation := &People{
	// 	name: "爷爷",
	// 	child: &People{
	// 		name: "爸爸",
	// 		child: &People{
	// 			name: "我",
	// 		},
	// 	},
	// }

	// fmt.Println(relation)
	s := &songer{
		name:   "Bob",
		age:    18,
		sex:    1,
		adress: "地址",
	}
	s.sing("演员")

}

func NewCatByName(name string) *Cat {
	return &Cat{
		Name: name,
	}
}

func NewCatByColor(color string) *Cat {
	return &Cat{
		Color: color,
	}
}

func (s *songer) sing(name string) {
	fmt.Printf("%v唱了<<%v>>很好听", s.name, name)
}
